#include <windows.h>
#include <iostream>
using namespace std;

int main()
{
     HANDLE console = GetStdHandle(STD_INPUT_HANDLE);
     DWORD mode;
     GetConsoleMode(console, &mode);
     SetConsoleMode(console, mode & ~ENABLE_LINE_INPUT);
     //111111111112222222222333333333344444444445555555555666666666677777777778888888888

     char answer;
     bool have_blaster;

     cout << "Welcome to the adventure of a lifetime, a situation will be described to you" << endl;
     cout << "and you will choose one of two outcomes to move the story forward. Good luck!" << endl;
     cout << endl;

describe_space_port:
     have_blaster = false;

     cout << endl;
     cout << "Stepping onto the polished metal plated floor of Diagon 9's space dock, you" << endl;
     cout << "feel slightly uneasy knowing that you still owe money to Gordon, who runs" << endl;
     cout << "the cantina. Still, you are running quite low on resources and trades have to" << endl;
     cout << "be made, so you decide to chance it and hopefully not run into him. You can go" << endl;
     cout << "to the market or visit the armorer to sell those rusty lasers you picked of" << endl;
     cout << "that rusty fighter on Treyarch" << endl;
     cout << endl;
     cout << "Do you:" << endl;
     cout << "[e] go to the market; or" << endl;
     cout << "[f] visit the armorer" << endl;
     cout << endl;
     cout << ">";

     cin >> answer;

     if (answer == 'e') goto market;
     if (answer == 'f') goto armorer;
     goto unknown_answer;

market:
     cout << "The market seems abit rundown considering how polished the dock is, you" << endl;
     cout << "approach the spice seller and offer him your exotic malaroc spice." << endl;
     cout << "In exchange he offers a rusty gore-tech blaster which seems to be in working" << endl;
     cout << "condition" << endl;
     cout << endl;
     cout << "Do you:" << endl;
     cout << "[e] accept the blaster; or" << endl;
     cout << "[f] refuse and throw it in his face" << endl;
     cout << endl;
     cout << ">";
     cin >> answer;

     switch (answer) {

     case 'e':
          cout << "You take the blaster and go back to the dock" << endl;
          have_blaster = true;
          goto end_dock;
          break;

     case 'f':
          cout << "You spit on the blaster and go back to the dock" << endl;
          have_blaster = false;
          goto end_dock;
          break;

     default:
          cout << "Don't understand, try again" << endl;
          goto describe_space_port;
          break;
     }

end_dock:
     cout << "Arriving at the space dock, you see that Gordon is there with his thugs," << endl;
     cout << "seeing you, he tells his evil crew to shoot" << endl;
     cout << endl;
     if (have_blaster) goto happy_end;
     cout << "They fire and you die, should've taken the blaster you git!" << endl << endl;
     cout << "Press [f] to restart";
     cout << endl;
     cin >> answer;

     goto describe_space_port;

happy_end:
     cout << "You blow their heads off and punch Gordon in the balls, happy end" << endl;
     cout << "Press [f] to restart";
     cout << endl;
     cin >> answer;


armorer:
     cout << "Johnny, who runs the armory greets you \"Get the hell out of here you" << endl;
     cout << "wife stealing bastard\"  " << endl;
     cout << endl;
     goto describe_space_port;



unknown_answer:
     cout << "Don't understand, try again" << endl;
     goto describe_space_port;
     cin >> answer;


the_end:

     return 0;


}

